<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>运算符之赋值运算符</title>
</head>
<body>
    
</body>
</html>
<script>
    // 赋值运算符用于给变量赋值
    // 常用的赋值运算符，当然就是等号（=）
    var num1 = 100
    var num2 = num1
    console.log(num2) //100

    // +=  x+=y  => x=x+y
    var x = 10;
    var y = 10;
    console.log(x += y) // x = x + y   x = 20

    //-=
    console.log(x -= y) // 10

    // *=
    console.log(x *= y) //100

    // /=
    console.log(x /= y) //10

    // %=
    console.log(x %= y) //0

</script>